package calvin.study.rabbitmq.config.database;

import org.mybatis.spring.mapper.MapperScannerConfigurer;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @ClassName:扫描Mybatis的Dao对象
 * @Description:TODO(描述这个类的作用)   
 * @author:Calvin.W
 * @date:2022年1月10日 下午5:09:16
 */
@Configuration
@AutoConfigureAfter(MybatisDataSourceConfig.class)//优先加载完成后,加载此类
public class MybatisMapperScanerConfig {

	@Bean
	public MapperScannerConfigurer mapperScannerConfigurer() {
		MapperScannerConfigurer mapperScannerConfigurer = new MapperScannerConfigurer();
		mapperScannerConfigurer.setSqlSessionFactoryBeanName("sqlSessionFactory");
		mapperScannerConfigurer.setBasePackage("calvin.study.rabbitmq.dao");//dao包路径
		return mapperScannerConfigurer;
	}

}
